package com.mashibing.internalcommon.utils;

/**
 * @title: ReisPrefixUtils
 * @Author Z先森
 * @Date: 2022/9/20 9:59
 * @Version 1.0
 */
public class RedisPrefixUtils {
     static String verificationCodePrefix = "passenger-verification-code-";

    // token存储的前缀
     static String tokenPrefix = "token-";

    /**
     * 根据手机号，生成key
     * @param phone
     * @param
     * @return
     */
    public static String generatorKeyByPhone(String phone){
        return verificationCodePrefix + "-" + phone;
    }

    /**
     * 根据手机号和身份标识，生成token
     * @param phone
     * @param identity
     * @return
     */
    public static String generatorTokenKey(String phone , String identity , String tokenType){
        return tokenPrefix + phone + "-" + identity + "-" + tokenType;
    }

}
